package IO;

import java.io.File;

public class Dis {
    public static void listAllFilesAndDirs2(String path){
        File dir =new File(path);
        File[] names=dir.listFiles();
        for (int i = 0; i <names.length ; i++) {
            File file=names[i];
            if (file.isFile())
            {
                System.out.println(("子文件"));
                System.out.println(file.getName());

            }else if (file.isDirectory())
                System.out.println(("子目录"));
            System.out.println(file.getName());

        }
    }
}
